<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>v-if-else if-else</title>
  <script src="../js/vue.min.js"></script>
</head>

<body>
  <div id ="app"> 
    <h2 v-if="score > 90">优秀</h2>
    <h2 v-else-if="score >= 80">良好</h2>
    <h2 v-else-if="score >= 60">及格</h2>
    <h2 v-else>不及格</h2>
    计算属性(推荐)：
    <h1>{{result}} </h1>
  </div>

  <script>
   var vm = new Vue({
    el: '#app',
    data: { 
      score: 98,
    },
    computed: {
      result() {
        let showMessage = '';
        if(this.score >= 90){
          showMessage = '优秀';
        } else if(this.score >= 80) {
          showMessage = '良好';
        } else if(this.score >= 60) {
          showMessage = '及格';
        } else {
          showMessage = '不及格';
        }
        return showMessage;
      }
    },
    methods: {}
   });
  </script>
</body>

</html>